package com.example.travel.service;

import com.example.travel.mapper.UserMessageMapper;
import com.example.travel.pojo.orm.UserMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserMessageService {
    @Autowired
    private UserMessageMapper mapper;
    public List<UserMessage> getMessageByFromToId(int userFrom, int userTo){
        return mapper.getMessageByFromToId(userFrom,userTo);
    }

    public boolean addMessage(UserMessage message){
        return mapper.addMessage(message)==1;
    }

}
